package com.gzdh.dishrecognition.ui.pre;

import android.content.Context;
import android.view.Display;
import android.widget.TextView;

import com.gzdh.dishrecognition.R;
import com.gzdh.dishrecognition.config.SysConstConfig;
import com.gzdh.dishrecognition.ui.base.BasePresentation;

public class CardInfoPre extends BasePresentation {

    private TextView msgTv;

    private TextView okBut;

    public CardInfoPre(Context context, Display display) {
        super(context, display);
    }

    @Override
    protected int getLayoutId() {
        return R.layout.pre_dialog_msg;
    }

    @Override
    protected void initView() {
        msgTv = findViewById(R.id.msgTv);
        okBut = findViewById(R.id.okBut);
    }

    @Override
    protected void initData() {
        okBut.setOnClickListener(view -> hide());
    }

    @Override
    public void show() {
        if (!SysConstConfig.getInstance().isAllowPreDin()) {
            super.show();
        }
    }

    public void setMsgText(String msg) {
        msgTv.setText(msg);
    }
}
